import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/components/cq-layout'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    children: [
      {
        path: '/',
        redirect: '/index'
      },
      {
        path: '/index',
        components: () => import('@/views/home')
      },
      {
        path: '/about',
        components: () => import('@/views/about')
      },
      {
        path: '/case',
        components: () => import('@/views/case')
      },
      {
        path: '/apply',
        components: () => import('@/views/apply')
      },
      {
        path: '/news',
        components: () => import('@/views/news')
      },
      {
        path: '/detail/:id',
        components: () => import('@/views/detail')
      },
      {
        path: '*',
        component: () => import('@/views/errPage')
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
